// window._ = require('underscore')
var env = process.env.NODE_ENV
import Vue from 'vue'
import App from './App.vue'

// import VueResource from 'vue-resource'
// Vue.use(VueResource)
// import {sync} from 'vuex-router-sync'
import store from './store'

import VueRouter from 'vue-router'
import routes from './router/router'
Vue.use(VueRouter)


import baseUrl from './config/env'

// 判断是否使用mockjs
  if (baseUrl === ''){
    require ('./test/mock')
  }


import globalMixin from './mixins/globalMixin'
Vue.mixin(globalMixin)

import 'element-ui/lib/theme-default/index.css'
import {
  Table as ElTable,
  TableColumn as ElTableColumn,
  Row as ElRow,
  Col as ElCol,
  Input as ElInput,
  Popover as ElPopover,
  // Breadcrumb as ElBreadcrumb,
  // BreadcrumbItem as ElBreadcrumbitem,
  Select as ElSelect,
  Option as ElOption,
  Pagination as ElPagination,
  Dialog as ElDialog,
  Button as ElButton,
  ButtonGroup as ElButtonGroup,
  Form as ElForm,
  FormItem as ElFormItem,
  Radio as ElRadio,
  RadioGroup as ElRadioGroup,
  DatePicker as ElDatePicker,
  Cascader,
  Loading,
  Notification
} from 'element-ui/lib/'

Vue.use(ElTable)
Vue.use(ElTableColumn)
Vue.use(ElRow)
Vue.use(ElCol)
Vue.use(ElInput)
Vue.use(ElPopover)
Vue.use(Loading)
Vue.use(Cascader)
// Vue.use(ElBreadcrumb)
// Vue.use(ElBreadcrumbitem)
Vue.use(ElSelect)
Vue.use(ElOption)
Vue.use(ElPagination)
Vue.use(ElDialog)
Vue.use(ElButton)
Vue.use(ElButtonGroup)
Vue.use(ElForm)
Vue.use(ElFormItem)
Vue.use(ElRadio)
Vue.use(ElRadioGroup)
Vue.use(ElDatePicker)
// Vue.use(Notification)
// https://github.com/vuejs/vuex-router-sync
// sync(store, router)
// 按需加载引用方法
// https://github.com/ElemeFE/element/issues/2024
// https://github.com/ElemeFE/element/issues/2434
Vue.prototype.$notify = Notification

const router = new VueRouter({
  // mode: 'history',
  routes
})
// 全局混合
// Vue.http.options.emulateJSON = true
/* eslint-disable no-new */
new Vue({
  el: '#root',
  // mixins: [globalMixin],
  router,
  store,
  created () {
  },
  render: h => h(App)
})

